<%@ page import="java.util.List" %>
<%@ page import="entity.Question" %><%--
  Created by IntelliJ IDEA.
  User: 44814
  Date: 2021/7/3
  Time: 20:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<center>
    <form action="/myWeb/exam">
        <table border="2px" width="800px">
            <tr>
                <th>试题编号</th>
                <th>题目信息</th>
                <th>A</th>
                <th>B</th>
                <th>C</th>
                <th>D</th>
                <th>答案</th>
            </tr>

                <%
                    List<Question> questionList = (List<Question>) request.getAttribute("key");
                    for (Question question: questionList){
                %>
                        <tr align="center">
                            <td><%=question.getQuestionId()%></td>
                            <td><%=question.getTitle()%></td>
                            <td><%=question.getOptionA()%></td>
                            <td><%=question.getOptionB()%></td>
                            <td><%=question.getOptionC()%></td>
                            <td><%=question.getOptionD()%></td>
                            <td>
                                <input type="radio" name="answer_<%=question.getQuestionId()%>" value="A">A
                                <input type="radio" name="answer_<%=question.getQuestionId()%>" value="B">B
                                <input type="radio" name="answer_<%=question.getQuestionId()%>" value="C">C
                                <input type="radio" name="answer_<%=question.getQuestionId()%>" value="D">D
                            </td>
                        </tr>
                <%
                    }
                %>
                <tr align="center">
                    <td colspan="3"><input type="submit" value="交卷"></td>
                    <td colspan="4"><input type="reset" value="重做"></td>
                </tr>
        </table>
    </form>
</center>
